package com.hdl;

import com.hdl.service.IHelloService;
import com.hdl.service.impl.HelloServiceImpl;

import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

/**
 * 类名 ServerMain
 * 描述 TODO
 *
 * @author hedonglin
 * @version 1.0
 * @date 2020/6/9 12:32
 */
public class ServerMain {
    public static void main(String[] args) throws RemoteException, AlreadyBoundException, MalformedURLException {
        // 创建服务
        IHelloService helloService = new HelloServiceImpl();

        // 创建注册表
        LocateRegistry.createRegistry(8888);

        // 绑定
        Naming.bind("//127.0.0.1:8888/hello", helloService);
    }
}
